Method and apparatus for processing video signal

ABSTRACT

A method for decoding a video according to the present invention may comprise: determining whether to divide a current block with quad tree partitioning, and dividing the current block into four partitions based on a vertical line and a horizontal line when it is determined that the current block is divided with the quad tree partitioning.

TECHNICAL FIELD

The present invention relates to a method and an apparatus forprocessing video signal.

BACKGROUND ART

Recently, demands for high-resolution and high-quality images such ashigh definition (HD) images and ultra-high definition (UHD) images haveincreased in various application fields. However, higher resolution andquality image data has increasing amounts of data in comparison withconventional image data. Therefore, when transmitting image data byusing a medium such as conventional wired and wireless broadbandnetworks, or when storing image data by using a conventional storagemedium, costs of transmitting and storing increase. In order to solvethese problems occurring with an increase in resolution and quality ofimage data, high-efficiency image encoding/decoding techniques may beutilized.

Image compression technology includes various techniques, including: aninter-prediction technique of predicting a pixel value included in acurrent picture from a previous or subsequent picture of the currentpicture; an intra-prediction technique of predicting a pixel valueincluded in a current picture by using pixel information in the currentpicture; an entropy encoding technique of assigning a short code to avalue with a high appearance frequency and assigning a long code to avalue with a low appearance frequency; etc. Image data may beeffectively compressed by using such image compression technology, andmay be transmitted or stored.

In the meantime, with demands for high-resolution images, demands forstereographic image content, which is a new image service, have alsoincreased. A video compression technique for effectively providingstereographic image content with high resolution and ultra-highresolution is being discussed.

DISCLOSURE Technical Problem

An object of the present invention is to provide a method and anapparatus for efficiently splitting an encoding/decoding target block inencoding/decoding a video signal.

An object of the present invention is to provide a method and anapparatus for splitting an encoding/decoding target block into blocks ofa symmetric type or an asymmetric type in encoding/decoding a videosignal.

An object of the present invention is to provide a method and anapparatus for splitting an encoding/decoding target block to comprise apolygonal shaped partition.

An object of the present invention is to provide a method and anapparatus for variably selecting the number of partitions of theencoding/decoding target block.

The technical objects to be achieved by the present invention are notlimited to the above-mentioned technical problems. And, other technicalproblems that are not mentioned will be apparently understood to thoseskilled in the art from the following description.

Technical Solution

A method and an apparatus for decoding a video signal according to thepresent invention may determine whether to divide a current block withquad tree partitioning, and divide the current block into fourpartitions based on a vertical line and a horizontal line when it isdetermined that the current block is divided with the quad treepartitioning. Here, at least one of the vertical line and the horizontalline may divide the current block asymmetrically.

A method and an apparatus for encoding a video signal according to thepresent invention may determine whether to divide a current block withquad tree partitioning, and divide the current block into fourpartitions based on a vertical line and a horizontal line when it isdetermined that the current block is divided with the quad treepartitioning. Here, at least one of the vertical line and the horizontalline may divide the current block asymmetrically.

In the method and the apparatus for encoding/decoding a video signalaccording to the present invention, a first indicator indicating whetherat least one of the vertical line or the horizontal line is to be usedfor asymmetric partitioning may be decoded/encoded, and a secondindicator may be decoded/encoded to specify a location of the verticalline or the horizontal line when the first indicator indicates that thevertical line or the horizontal line is used for the asymmetricpartitioning.

In the method and the apparatus for encoding/decoding a video signalaccording to the present invention, the current block may be dividedinto four partitions by two horizontal lines and one vertical line whichdividing one of three blocks divided by the two horizontal lines, or bytwo vertical lines and one horizontal line which dividing one of threeblocks divided by the two vertical lines.

In the method and the apparatus for encoding/decoding a video signalaccording to the present invention, whether to divide the current blockwith binary tree partitioning may be determined when it is determinedthat the current block is not divided with the quad tree partitioning,and the current block may be divided into two partitions when it isdetermined that the current block is divided with the binary treepartitioning.

In the method and the apparatus for encoding/decoding a video signalaccording to the present invention, whether polygon binary treepartitioning is to be applied to the current block may be determined,and when the polygon binary tree partitioning is applied to the currentblock, the current block may be divided into a rectangular shapedpartition and a polygonal shaped partition.

In the method and the apparatus for encoding/decoding a video signalaccording to the present invention, the polygonal shaped partition maybe divided into sub-partitions of rectangular shapes and prediction onthe polygonal shaped partition is performed for each sub-partition.

In the method and the apparatus for encoding/decoding a video signalaccording to the present invention, the current block may be divided bya vertical line or a horizontal line dividing the current block into twopartitions, and the vertical line or the horizontal line may divide thecurrent block asymmetrically.

The features briefly summarized above for the present invention are onlyillustrative aspects of the detailed description of the invention thatfollows, but do not limit the scope of the invention.

Advantageous Effects

According to the present invention, encoding/decoding efficiency can beimproved by efficiently splitting an encoding/decoding target block.

According to the present invention, encoding/decoding efficiency can beimproved by splitting an encoding/decoding target block into blocks of asymmetric type or an asymmetric type.

According to the present invention, encoding/decoding efficiency can beimproved by splitting an encoding/decoding target block to comprisepolygonal shaped partition.

According to the present invention, encoding/decoding efficiency can beimproved by variably selecting the number of partitions of theencoding/decoding target block.

The effects obtainable by the present invention are not limited to theabove-mentioned effects, and other effects not mentioned can be clearlyunderstood by those skilled in the art from the description below.

DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram illustrating a device for encoding a videoaccording to an embodiment of the present invention.

FIG. 2 is a block diagram illustrating a device for decoding a videoaccording to an embodiment of the present invention.

FIG. 3 is a diagram illustrating partition modes that can be applied toa coding block when the coding block is encoded by inter prediction.

FIG. 4 is a diagram illustrating an example of hierarchicallypartitioning a coding block based on a tree structure according to anembodiment of the present invention.

FIG. 5 is a diagram illustrating a partition type in which binarytree-based partitioning is allowed according to an embodiment of thepresent invention.

FIGS. 6A and 6B are diagrams illustrating an example in which only abinary tree-based partition of a predetermined type is allowed accordingto an embodiment of the present invention.

FIG. 7 is a diagram for explaining an example in which informationrelated to the allowable number of binary tree partitioning isencoded/decoded, according to an embodiment to which the presentinvention is applied.

FIG. 8 illustrates a partition type of a coding block based onasymmetric binary tree partitioning.

FIG. 9 shows an example in which a coding block is divided into aplurality of coding blocks using QTBT and asymmetric binary treepartitioning.

FIG. 10 is a diagram illustrating partition types which can be appliedto a coding block.

FIG. 11 is a diagram illustrating quad tree partition types of a codingblock.

FIG. 12 is a diagram showing an example of dividing a coding block bycombining a plurality of vertical lines/horizontal lines and onehorizontal line/vertical line.

FIG. 13 is a diagram illustrating partition types according to polygonalbinary tree partitioning.

FIG. 14 is a diagram illustrating an example in which a polygonalpartition is divided into sub-partitions.

FIG. 15 shows an example in which a coding block is partitioned based ona triple tree.

FIG. 16 and FIG. 17 illustrate partition types of a coding blockaccording to a multi-tree partitioning method.

FIG. 18 is a flowchart illustrating partitioning processes of a codingblock according to an embodiment of the present invention.

FIG. 19 is a flowchart illustrating processes of determining a partitiontype of quad tree partitioning according to an embodiment of the presentinvention.

FIG. 20 is a flowchart illustrating processes of determining a partitiontype of binary tree partitioning according to an embodiment of thepresent invention.

FIG. 21 is a flowchart illustrating processes of obtaining a residualsample according to an embodiment to which the present invention isapplied.

MODE FOR INVENTION

A variety of modifications may be made to the present invention andthere are various embodiments of the present invention, examples ofwhich will now be provided with reference to drawings and described indetail. However, the present invention is not limited thereto, and theexemplary embodiments can be construed as including all modifications,equivalents, or substitutes in a technical concept and a technical scopeof the present invention. The similar reference numerals refer to thesimilar element in described the drawings.

Terms used in the specification, ‘first’, ‘second’, etc. can be used todescribe various components, but the components are not to be construedas being limited to the terms. The terms are only used to differentiateone component from other components. For example, the ‘first’ componentmay be named the ‘second’ component without departing from the scope ofthe present invention, and the ‘second’ component may also be similarlynamed the ‘first’ component. The term ‘and/or’ includes a combination ofa plurality of items or any one of a plurality of terms.

It will be understood that when an element is simply referred to asbeing ‘connected to’ or ‘coupled to’ another element without being‘directly connected to’ or ‘directly coupled to’ another element in thepresent description, it may be ‘directly connected to’ or ‘directlycoupled to’ another element or be connected to or coupled to anotherelement, having the other element intervening therebetween. In contrast,it should be understood that when an element is referred to as being“directly coupled” or “directly connected” to another element, there areno intervening elements present.

The terms used in the present specification are merely used to describeparticular embodiments, and are not intended to limit the presentinvention. An expression used in the singular encompasses the expressionof the plural, unless it has a clearly different meaning in the context.In the present specification, it is to be understood that terms such as“including”, “having”, etc. are intended to indicate the existence ofthe features, numbers, steps, actions, elements, parts, or combinationsthereof disclosed in the specification, and are not intended to precludethe possibility that one or more other features, numbers, steps,actions, elements, parts, or combinations thereof may exist or may beadded.

Hereinafter, preferred embodiments of the present invention will bedescribed in detail with reference to the accompanying drawings.Hereinafter, the same constituent elements in the drawings are denotedby the same reference numerals, and a repeated description of the sameelements will be omitted.

FIG. 1 is a block diagram illustrating a device for encoding a videoaccording to an embodiment of the present invention.

Referring to FIG. 1, the device 100 for encoding a video may include: apicture partitioning module 110, prediction modules 120 and 125, atransform module 130, a quantization module 135, a rearrangement module160, an entropy encoding module 165, an inverse quantization module 140,an inverse transform module 145, a filter module 150, and a memory 155.

The constitutional parts shown in FIG. 1 are independently shown so asto represent characteristic functions different from each other in thedevice for encoding a video. Thus, it does not mean that eachconstitutional part is constituted in a constitutional unit of separatedhardware or software. In other words, each constitutional part includeseach of enumerated constitutional parts for convenience. Thus, at leasttwo constitutional parts of each constitutional part may be combined toform one constitutional part or one constitutional part may be dividedinto a plurality of constitutional parts to perform each function. Theembodiment where each constitutional part is combined and the embodimentwhere one constitutional part is divided are also included in the scopeof the present invention, if not departing from the essence of thepresent invention.

Also, some of constituents may not be indispensable constituentsperforming essential functions of the present invention but be selectiveconstituents improving only performance thereof. The present inventionmay be implemented by including only the indispensable constitutionalparts for implementing the essence of the present invention except theconstituents used in improving performance. The structure including onlythe indispensable constituents except the selective constituents used inimproving only performance is also included in the scope of the presentinvention.

The picture partitioning module 110 may partition an input picture intoone or more processing units. Here, the processing unit may be aprediction unit (PU), a transform unit (TU), or a coding unit (CU). Thepicture partitioning module 110 may partition one picture intocombinations of multiple coding units, prediction units, and transformunits, and may encode a picture by selecting one combination of codingunits, prediction units, and transform units with a predeterminedcriterion (e.g., cost function).

For example, one picture may be partitioned into multiple coding units.A recursive tree structure, such as a quad tree structure, may be usedto partition a picture into coding units. A coding unit which ispartitioned into other coding units with one picture or a largest codingunit as a root may be partitioned with child nodes corresponding to thenumber of partitioned coding units. A coding unit which is no longerpartitioned by a predetermined limitation serves as a leaf node. Thatis, when it is assumed that only square partitioning is possible for onecoding unit, one coding unit may be partitioned into four other codingunits at most.

Hereinafter, in the embodiment of the present invention, the coding unitmay mean a unit performing encoding, or a unit performing decoding.

A prediction unit may be one of partitions partitioned into a square ora rectangular shape having the same size in a single coding unit, or aprediction unit may be one of partitions partitioned so as to have adifferent shape/size in a single coding unit.

When a prediction unit subjected to intra prediction is generated basedon a coding unit and the coding unit is not the smallest coding unit,intra prediction may be performed without partitioning the coding unitinto multiple prediction units N×N.

The prediction modules 120 and 125 may include an inter predictionmodule 120 performing inter prediction and an intra prediction module125 performing intra prediction. Whether to perform inter prediction orintra prediction for the prediction unit may be determined, and detailedinformation (e.g., an intra prediction mode, a motion vector, areference picture, etc.) according to each prediction method may bedetermined. Here, the processing unit subjected to prediction may bedifferent from the processing unit for which the prediction method anddetailed content is determined. For example, the prediction method, theprediction mode, etc. may be determined by the prediction unit, andprediction may be performed by the transform unit. A residual value(residual block) between the generated prediction block and an originalblock may be input to the transform module 130. Also, prediction modeinformation, motion vector information, etc. used for prediction may beencoded with the residual value by the entropy encoding module 165 andmay be transmitted to a device for decoding a video. When a particularencoding mode is used, it is possible to transmit to a device fordecoding video by encoding the original block as it is withoutgenerating the prediction block through the prediction modules 120 and125.

The inter prediction module 120 may predict the prediction unit based oninformation of at least one of a previous picture or a subsequentpicture of the current picture, or may predict the prediction unit basedon information of some encoded regions in the current picture, in somecases. The inter prediction module 120 may include a reference pictureinterpolation module, a motion prediction module, and a motioncompensation module.

The reference picture interpolation module may receive reference pictureinformation from the memory 155 and may generate pixel information of aninteger pixel or less then the integer pixel from the reference picture.In the case of luma pixels, an 8-tap DCT-based interpolation filterhaving different filter coefficients may be used to generate pixelinformation of an integer pixel or less than an integer pixel in unitsof a ¼ pixel. In the case of chroma signals, a 4-tap DCT-basedinterpolation filter having different filter coefficient may be used togenerate pixel information of an integer pixel or less than an integerpixel in units of a ⅛ pixel.

The motion prediction module may perform motion prediction based on thereference picture interpolated by the reference picture interpolationmodule. As methods for calculating a motion vector, various methods,such as a full search-based block matching algorithm (FBMA), a threestep search (TSS), a new three-step search algorithm (NTS), etc., may beused. The motion vector may have a motion vector value in units of a ½pixel or a ¼ pixel based on an interpolated pixel. The motion predictionmodule may predict a current prediction unit by changing the motionprediction method. As motion prediction methods, various methods, suchas a skip method, a merge method, an AMVP (Advanced Motion VectorPrediction) method, an intra block copy method, etc., may be used.

The intra prediction module 125 may generate a prediction unit based onreference pixel information neighboring to a current block which ispixel information in the current picture. When the neighboring block ofthe current prediction unit is a block subjected to inter prediction andthus a reference pixel is a pixel subjected to inter prediction, thereference pixel included in the block subjected to inter prediction maybe replaced with reference pixel information of a neighboring blocksubjected to intra prediction. That is, when a reference pixel is notavailable, at least one reference pixel of available reference pixelsmay be used instead of unavailable reference pixel information.

Prediction modes in intra prediction may include a directionalprediction mode using reference pixel information depending on aprediction direction and a non-directional prediction mode not usingdirectional information in performing prediction. A mode for predictingluma information may be different from a mode for predicting chromainformation, and in order to predict the chroma information, intraprediction mode information used to predict luma information orpredicted luma signal information may be utilized.

In performing intra prediction, when the size of the prediction unit isthe same as the size of the transform unit, intra prediction may beperformed on the prediction unit based on pixels positioned at the left,the top left, and the top of the prediction unit. However, in performingintra prediction, when the size of the prediction unit is different fromthe size of the transform unit, intra prediction may be performed usinga reference pixel based on the transform unit. Also, intra predictionusing N×N partitioning may be used for only the smallest coding unit.

In the intra prediction method, a prediction block may be generatedafter applying an AIS (Adaptive Intra Smoothing) filter to a referencepixel depending on the prediction modes. The type of the AIS filterapplied to the reference pixel may vary. In order to perform the intraprediction method, an intra prediction mode of the current predictionunit may be predicted from the intra prediction mode of the predictionunit neighboring to the current prediction unit. In prediction of theprediction mode of the current prediction unit by using mode informationpredicted from the neighboring prediction unit, when the intraprediction mode of the current prediction unit is the same as the intraprediction mode of the neighboring prediction unit, informationindicating that the prediction modes of the current prediction unit andthe neighboring prediction unit are equal to each other may betransmitted using predetermined flag information. When the predictionmode of the current prediction unit is different from the predictionmode of the neighboring prediction unit, entropy encoding may beperformed to encode prediction mode information of the current block.

Also, a residual block including information on a residual value whichis a different between the prediction unit subjected to prediction andthe original block of the prediction unit may be generated based onprediction units generated by the prediction modules 120 and 125. Thegenerated residual block may be input to the transform module 130.

The transform module 130 may transform the residual block including theinformation on the residual value between the original block and theprediction unit generated by the prediction modules 120 and 125 by usinga transform method, such as discrete cosine transform (DCT), discretesine transform (DST), and KLT. Whether to apply DCT, DST, or KLT inorder to transform the residual block may be determined based on intraprediction mode information of the prediction unit used to generate theresidual block.

The quantization module 135 may quantize values transformed to afrequency domain by the transform module 130. Quantization coefficientsmay vary depending on the block or importance of a picture. The valuescalculated by the quantization module 135 may be provided to the inversequantization module 140 and the rearrangement module 160.

The rearrangement module 160 may rearrange coefficients of quantizedresidual values.

The rearrangement module 160 may change a coefficient in the form of atwo-dimensional block into a coefficient in the form of aone-dimensional vector through a coefficient scanning method. Forexample, the rearrangement module 160 may scan from a DC coefficient toa coefficient in a high frequency domain using a zigzag scanning methodso as to change the coefficients to be in the form of one-dimensionalvectors. Depending on the size of the transform unit and the intraprediction mode, vertical direction scanning where coefficients in theform of two-dimensional blocks are scanned in the column direction orhorizontal direction scanning where coefficients in the form oftwo-dimensional blocks are scanned in the row direction may be usedinstead of zigzag scanning. That is, which scanning method among zigzagscanning, vertical direction scanning, and horizontal direction scanningis used may be determined depending on the size of the transform unitand the intra prediction mode.

The entropy encoding module 165 may perform entropy encoding based onthe values calculated by the rearrangement module 160. Entropy encodingmay use various encoding methods, for example, exponential Golombcoding, context-adaptive variable length coding (CAVLC), andcontext-adaptive binary arithmetic coding (CABAC).

The entropy encoding module 165 may encode a variety of information,such as residual value coefficient information and block typeinformation of the coding unit, prediction mode information, partitionunit information, prediction unit information, transform unitinformation, motion vector information, reference frame information,block interpolation information, filtering information, etc. from therearrangement module 160 and the prediction modules 120 and 125.

The entropy encoding module 165 may entropy encode the coefficients ofthe coding unit input from the rearrangement module 160.

The inverse quantization module 140 may inversely quantize the valuesquantized by the quantization module 135 and the inverse transformmodule 145 may inversely transform the values transformed by thetransform module 130. The residual value generated by the inversequantization module 140 and the inverse transform module 145 may becombined with the prediction unit predicted by a motion estimationmodule, a motion compensation module, and the intra prediction module ofthe prediction modules 120 and 125 such that a reconstructed block canbe generated.

The filter module 150 may include at least one of a deblocking filter,an offset correction unit, and an adaptive loop filter (ALF).

The deblocking filter may remove block distortion that occurs due toboundaries between the blocks in the reconstructed picture. In order todetermine whether to perform deblocking, the pixels included in severalrows or columns in the block may be a basis of determining whether toapply the deblocking filter to the current block. When the deblockingfilter is applied to the block, a strong filter or a weak filter may beapplied depending on required deblocking filtering strength. Also, inapplying the deblocking filter, horizontal direction filtering andvertical direction filtering may be processed in parallel.

The offset correction module may correct offset with the originalpicture in units of a pixel in the picture subjected to deblocking. Inorder to perform the offset correction on a particular picture, it ispossible to use a method of applying offset in consideration of edgeinformation of each pixel or a method of partitioning pixels of apicture into the predetermined number of regions, determining a regionto be subjected to perform offset, and applying the offset to thedetermined region.

Adaptive loop filtering (ALF) may be performed based on the valueobtained by comparing the filtered reconstructed picture and theoriginal picture. The pixels included in the picture may be divided intopredetermined groups, a filter to be applied to each of the groups maybe determined, and filtering may be individually performed for eachgroup. Information on whether to apply ALF and a luma signal may betransmitted by coding units (CU). The shape and filter coefficient of afilter for ALF may vary depending on each block. Also, the filter forALF in the same shape (fixed shape) may be applied regardless ofcharacteristics of the application target block.

The memory 155 may store the reconstructed block or picture calculatedthrough the filter module 150. The stored reconstructed block or picturemay be provided to the prediction modules 120 and 125 in performinginter prediction.

FIG. 2 is a block diagram illustrating a device for decoding a videoaccording to an embodiment of the present invention.

Referring to FIG. 2, the device 200 for decoding a video may include: anentropy decoding module 210, a rearrangement module 215, an inversequantization module 220, an inverse transform module 225, predictionmodules 230 and 235, a filter module 240, and a memory 245.

When a video bitstream is input from the device for encoding a video,the input bitstream may be decoded according to an inverse process ofthe device for encoding a video.

The entropy decoding module 210 may perform entropy decoding accordingto an inverse process of entropy encoding by the entropy encoding moduleof the device for encoding a video. For example, corresponding to themethods performed by the device for encoding a video, various methods,such as exponential Golomb coding, context-adaptive variable lengthcoding (CAVLC), and context-adaptive binary arithmetic coding (CABAC)may be applied.

The entropy decoding module 210 may decode information on intraprediction and inter prediction performed by the device for encoding avideo.

The rearrangement module 215 may perform rearrangement on the bitstreamentropy decoded by the entropy decoding module 210 based on therearrangement method used in the device for encoding a video. Therearrangement module may reconstruct and rearrange the coefficients inthe form of one-dimensional vectors to the coefficient in the form oftwo-dimensional blocks. The rearrangement module 215 may receiveinformation related to coefficient scanning performed in the device forencoding a video and may perform rearrangement via a method of inverselyscanning the coefficients based on the scanning order performed in thedevice for encoding a video.

The inverse quantization module 220 may perform inverse quantizationbased on a quantization parameter received from the device for encodinga video and the rearranged coefficients of the block.

The inverse transform module 225 may perform the inverse transform,i.e., inverse DCT, inverse DST, and inverse KLT, which is the inverseprocess of transform, i.e., DCT, DST, and KLT, performed by thetransform module on the quantization result by the device for encoding avideo. Inverse transform may be performed based on a transfer unitdetermined by the device for encoding a video. The inverse transformmodule 225 of the device for decoding a video may selectively performtransform schemes (e.g., DCT, DST, and KLT) depending on multiple piecesof information, such as the prediction method, the size of the currentblock, the prediction direction, etc.

The prediction modules 230 and 235 may generate a prediction block basedon information on prediction block generation received from the entropydecoding module 210 and previously decoded block or picture informationreceived from the memory 245.

As described above, like the operation of the device for encoding avideo, in performing intra prediction, when the size of the predictionunit is the same as the size of the transform unit, intra prediction maybe performed on the prediction unit based on the pixels positioned atthe left, the top left, and the top of the prediction unit. Inperforming intra prediction, when the size of the prediction unit isdifferent from the size of the transform unit, intra prediction may beperformed using a reference pixel based on the transform unit. Also,intra prediction using N×N partitioning may be used for only thesmallest coding unit.

The prediction modules 230 and 235 may include a prediction unitdetermination module, an inter prediction module, and an intraprediction module. The prediction unit determination module may receivea variety of information, such as prediction unit information,prediction mode information of an intra prediction method, informationon motion prediction of an inter prediction method, etc. from theentropy decoding module 210, may divide a current coding unit intoprediction units, and may determine whether inter prediction or intraprediction is performed on the prediction unit. By using informationrequired in inter prediction of the current prediction unit receivedfrom the device for encoding a video, the inter prediction module 230may perform inter prediction on the current prediction unit based oninformation of at least one of a previous picture or a subsequentpicture of the current picture including the current prediction unit.Alternatively, inter prediction may be performed based on information ofsome pre-reconstructed regions in the current picture including thecurrent prediction unit.

In order to perform inter prediction, it may be determined for thecoding unit which of a skip mode, a merge mode, an AMVP mode, and aninter block copy mode is used as the motion prediction method of theprediction unit included in the coding unit.

The intra prediction module 235 may generate a prediction block based onpixel information in the current picture. When the prediction unit is aprediction unit subjected to intra prediction, intra prediction may beperformed based on intra prediction mode information of the predictionunit received from the device for encoding a video. The intra predictionmodule 235 may include an adaptive intra smoothing (AIS) filter, areference pixel interpolation module, and a DC filter. The AIS filterperforms filtering on the reference pixel of the current block, andwhether to apply the filter may be determined depending on theprediction mode of the current prediction unit. AIS filtering may beperformed on the reference pixel of the current block by using theprediction mode of the prediction unit and AIS filter informationreceived from the device for encoding a video. When the prediction modeof the current block is a mode where AIS filtering is not performed, theAIS filter may not be applied.

When the prediction mode of the prediction unit is a prediction mode inwhich intra prediction is performed based on the pixel value obtained byinterpolating the reference pixel, the reference pixel interpolationmodule may interpolate the reference pixel to generate the referencepixel of an integer pixel or less than an integer pixel. When theprediction mode of the current prediction unit is a prediction mode inwhich a prediction block is generated without interpolation thereference pixel, the reference pixel may not be interpolated. The DCfilter may generate a prediction block through filtering when theprediction mode of the current block is a DC mode.

The reconstructed block or picture may be provided to the filter module240. The filter module 240 may include the deblocking filter, the offsetcorrection module, and the ALF.

Information on whether or not the deblocking filter is applied to thecorresponding block or picture and information on which of a strongfilter and a weak filter is applied when the deblocking filter isapplied may be received from the device for encoding a video. Thedeblocking filter of the device for decoding a video may receiveinformation on the deblocking filter from the device for encoding avideo, and may perform deblocking filtering on the corresponding block.

The offset correction module may perform offset correction on thereconstructed picture based on the type of offset correction and offsetvalue information applied to a picture in performing encoding.

The ALF may be applied to the coding unit based on information onwhether to apply the ALF, ALF coefficient information, etc. receivedfrom the device for encoding a video. The ALF information may beprovided as being included in a particular parameter set.

The memory 245 may store the reconstructed picture or block for use as areference picture or block, and may provide the reconstructed picture toan output module.

As described above, in the embodiment of the present invention, forconvenience of explanation, the coding unit is used as a termrepresenting a unit for encoding, but the coding unit may serve as aunit performing decoding as well as encoding.

In addition, a current block may represent a target block to beencoded/decoded. And, the current block may represent a coding treeblock (or a coding tree unit), a coding block (or a coding unit), atransform block (or a transform unit), a prediction block (or aprediction unit), or the like depending on an encoding/decoding step. Inthis specification, ‘unit’ represents a basic unit for performing aspecific encoding/decoding processes, and ‘block’ may represent a samplearray of a predetermined size. If there is no distinguish between them,the terms ‘block’ and ‘unit’ may be used interchangeably. For example,in the embodiments described below, it can be understood that a codingblock and a coding unit have mutually equivalent meanings.

A picture may be encoded/decoded by divided into base blocks having asquare shape or a non-square shape. At this time, the base block may bereferred to as a coding tree unit. The coding tree unit may be definedas a coding unit of the largest size allowed within a sequence or aslice. Information regarding whether the coding tree unit has a squareshape or has a non-square shape or information regarding a size of thecoding tree unit may be signaled through a sequence parameter set, apicture parameter set, or a slice header. The coding tree unit may bedivided into smaller size partitions. At this time, if it is assumedthat a depth of a partition generated by dividing the coding tree unitis 1, a depth of a partition generated by dividing the partition havingdepth 1 may be defined as 2. That is, a partition generated by dividinga partition having a depth k in the coding tree unit may be defined ashaving a depth k+1.

A partition of arbitrary size generated by dividing a coding tree unitmay be defined as a coding unit. The coding unit may be recursivelydivided or divided into base units for performing prediction,quantization, transform, or in-loop filtering, and the like. Forexample, a partition of arbitrary size generated by dividing the codingunit may be defined as a coding unit, or may be defined as a transformunit or a prediction unit, which is a base unit for performingprediction, quantization, transform or in-loop filtering and the like.

Alternatively, if a coding block is determined, a prediction blockhaving the same size as the coding block or smaller than the codingblock may be determined through predictive partitioning of the codingblock. The predictive partitioning of the coding block may be performedby a partition mode (Part_mode) indicating a partition type of thecoding block. A size or a shape of a prediction block may be determinedaccording to the partition mode of the coding block. The partition typeof the coding block may be determined through information specifying anyone of partition candidates. At this time, depending on a size, a shape,an encoding mode or the like of the coding block, the partitioncandidates available to the coding block may include an asymmetricpartition type (for example, nL×2N, nR×2N, 2N×nU, 2N×nD). For example,the partition candidates available to the coding block may be determinedaccording to the encoding mode of the current block. For example, FIG. 3illustrates partition modes that can be applied to a coding block whenthe coding block is encoded by inter prediction.

When a coding block is encoded by inter prediction, one of 8 partitionmodes can be applied to the coding block, as in the example shown inFIG. 3.

On the other hand, when a coding block is encoded by intra prediction, apartition mode of PART_2N×2N or PART_N×N can be applied to the codingblock.

PART_N×N may be applied when a coding block has a minimum size. Here,the minimum size of the coding block may be predefined in the encoderand the decoder. Alternatively, information regarding the minimum sizeof the coding block may be signaled via the bitstream. For example, theminimum size of the coding block is signaled through a slice header, sothat the minimum size of the coding block may be defined for each slice.

In another example, partition candidates available to a coding block maybe determined differently depending on at least one of a size or a shapeof the coding block. For example, the number or a type of partitioncandidates available to a coding block may be differently determinedaccording to at least one of a size or a shape of the coding block.

Alternatively, a type or the number of asymmetric partition candidatesamong partition candidates available to a coding block may be limiteddepending on a size or a shape of the coding block. For example, thenumber or a type of asymmetric partition candidates available to acoding block may be differently determined according to at least one ofa size or a shape of the coding block.

In general, a prediction block may have a size from 64×64 to 4×4.However, when a coding block is encoded by inter prediction, it ispossible to prevent the prediction block from having a 4×4 size in orderto reduce a memory bandwidth when performing motion compensation.

It is also possible to recursively divide a coding block using apartition mode. That is, a coding block can be divided according to thepartition mode indicated by a partition index, and each partitiongenerated by dividing the coding block can be defined as a coding block.

Hereinafter, a method of recursively dividing a coding unit will bedescribed in more detail. For convenience of explanation, it is assumedthat a coding tree unit is also included in a category of a coding unit.That is, in a later-described embodiment, a coding unit may refer to acoding tree unit, or may refer to a coding unit which is generated bydividing the coding tree unit. Also, when a coding block is recursivelydivided, it can be understood that the ‘partition’ generated by dividingthe coding block means ‘coding block’.

A coding unit may be divided by at least one line. At this time, theline dividing the coding unit may have a predetermined angle. Here, thepredetermined angle may be a value within a range of 0 degree to 360degree. For example, a line of 0 degree may mean a horizontal line, aline of 90 degree may mean a vertical line, and a line of 45 degree or135 degree may mean a diagonal line.

When a coding unit is divided by a plurality of lines, all of theplurality of lines may have the same angle. Alternatively, at least oneof the plurality of lines may have an angle different from the otherlines. Alternatively, the plurality of lines dividing a coding tree unitor a coding unit may be set to have a predefined angle difference (e.g.,90 degree).

Information about a line dividing a coding tree unit or a coding unitmay be defined and encoded as a partition mode. Alternatively,information on the number of lines, a direction of a line, an angle of aline, a position of a line in a block, or the like may be encoded.

For convenience of explanation, it is assumed in the followingembodiments that a coding tree unit or a coding unit is divided into aplurality of coding units using at least one of a vertical line and ahorizontal line.

If it is assumed that partitioning of a coding unit is performed basedon at least one of a vertical line and a horizontal line, the number ofvertical lines or horizontal lines partitioning the coding unit may beat least one or more. For example, the coding tree unit or the codingunit may be divided into two partitions using one vertical line or onehorizontal line, or the coding unit may be divided into three partitionsusing two vertical lines or two horizontal lines. Alternatively, thecoding unit may be partitioned into four partitions having a length anda width of ½ by using one vertical line and one horizontal line.

When a coding tree unit or a coding unit is divided into a plurality ofpartitions using at least one vertical line or at least one horizontalline, the partitions may have a uniform size. Alternatively, any onepartition may have a different size from the remaining partitions, oreach partition may have a different size.

In the embodiments described below, it is assumed that dividing a codingunit into 4 partitions is a quad-tree based partitioning and dividing acoding unit into 2 partitions is a binary-tree based partitioning. Inthe following figures, it is assumed that a predetermined number ofvertical lines or a predetermined number of horizontal lines are used todivide a coding unit, but it is also within a scope of the presentinvention to divide a coding unit into more number of partitions thanshown in the figures using a more number of vertical lines or a morenumber of horizontal lines shown in the figures, or to divide a codingunit into less number of partitions than shown in the figures.

FIG. 4 is a diagram illustrating an example of hierarchicallypartitioning a coding block based on a tree structure according to anembodiment of the present invention.

An input video signal is decoded in predetermined block units. Such adefault unit for decoding the input video signal is a coding block. Thecoding block may be a unit performing intra/inter prediction, transform,and quantization. In addition, a prediction mode (e.g., intra predictionmode or inter prediction mode) is determined in units of a coding block,and the prediction blocks included in the coding block may share thedetermined prediction mode. The coding block may be a square ornon-square block having an arbitrary size in a range of 8×8 to 64×64, ormay be a square or non-square block having a size of 128×128, 256×256,or more.

Specifically, the coding block may be hierarchically partitioned basedon at least one of a quad tree and a binary tree. Here, quad tree-basedpartitioning may mean that a 2N×2N coding block is partitioned into fourN×N coding blocks, and binary tree-based partitioning may mean that onecoding block is partitioned into two coding blocks. Even if the binarytree-based partitioning is performed, a square-shaped coding block mayexist in the lower depth.

Binary tree-based partitioning may be symmetrically or asymmetricallyperformed. In addition, the coding block partitioned based on the binarytree may be a square block or a non-square block, such as a rectangularshape. For example, as an example illustrated in FIG. 5, a partitiontype in which the binary tree-based partitioning is allowed may compriseat least one of a symmetric type of 2N×N (horizontal directionalnon-square coding unit) or N×2N (vertical direction non-square codingunit), asymmetric type of nL×2N, nR×2N, 2N×nU, or 2N×nD.

Binary tree-based partitioning may be limitedly allowed to one of asymmetric or an asymmetric type partition. In this case, constructingthe coding tree unit with square blocks may correspond to quad tree CUpartitioning, and constructing the coding tree unit with symmetricnon-square blocks may correspond to binary tree partitioning.Constructing the coding tree unit with square blocks and symmetricnon-square blocks may correspond to quad and binary tree CUpartitioning.

Binary tree-based partitioning may be performed on a coding block wherequad tree-based partitioning is no longer performed. Quad tree-basedpartitioning may no longer be performed on the coding block partitionedbased on the binary tree.

Furthermore, partitioning of a lower depth may be determined dependingon a partition type of an upper depth. For example, if binary tree-basedpartitioning is allowed in two or more depths, only the same type as thebinary tree partitioning of the upper depth may be allowed in the lowerdepth. For example, if the binary tree-based partitioning in the upperdepth is performed with 2N×N type, the binary tree-based partitioning inthe lower depth is also performed with 2N×N type. Alternatively, if thebinary tree-based partitioning in the upper depth is performed with N×2Ntype, the binary tree-based partitioning in the lower depth is alsoperformed with N×2N type.

On the contrary, it is also possible to allow, in a lower depth, only atype different from a binary tree partitioning type of an upper depth.

It may be possible to limit only a specific type of binary tree basedpartitioning to be used for sequence, slice, coding tree unit, or codingunit. As an example, only 2N×N type or N×2N type of binary tree-basedpartitioning may be allowed for the coding tree unit. An availablepartition type may be predefined in an encoder or a decoder. Orinformation on available partition type or on unavailable partition typeon may be encoded and then signaled through a bitstream.

FIGS. 6A and 6B are diagrams illustrating an example in which only aspecific type of binary tree-based partitioning is allowed. FIG. 6Ashows an example in which only N×2N type of binary tree-basedpartitioning is allowed, and FIG. 6B shows an example in which only 2N×Ntype of binary tree-based partitioning is allowed. In order to implementadaptive partitioning based on the quad tree or binary tree, informationindicating quad tree-based partitioning, information on the size/depthof the coding block that quad tree-based partitioning is allowed,information indicating binary tree-based partitioning, information onthe size/depth of the coding block that binary tree-based partitioningis allowed, information on the size/depth of the coding block thatbinary tree-based partitioning is not allowed, information on whetherbinary tree-based partitioning is performed in a vertical direction, ahorizontal direction, or the like may be used. For example,quad_split_flag indicates whether the coding block is to be divided intofour coding blocks, and binary_split_flag indicates whether the codingblock is to be divided into two coding blocks. When the coding block isdivided into two coding blocks, is hor_split_flag indicating whether apartitioning direction of the coding block is a vertical direction or ahorizontal direction may be signaled.

In addition, information on the number of times a binary treepartitioning is allowed, a depth at which the binary tree partitioningis allowed, or the number of the depths at which the binary treepartitioning is allowed may be obtained for a coding tree unit or aspecific coding unit. The information may be encoded in units of acoding tree unit or a coding unit, and may be transmitted to a decoderthrough a bitstream.

For example, a syntax ‘max_binary_depth_idx_minus1’ indicating a maximumdepth at which binary tree partitioning is allowed may beencoded/decoded through a bitstream. In this case,max_binary_depth_idx_minus1+1 may indicate the maximum depth at whichthe binary tree partitioning is allowed.

Referring to the example shown in FIG. 7, in FIG. 7, the binary treepartitioning has been performed for a coding unit having a depth of 2and a coding unit having a depth of 3. Accordingly, at least one ofinformation indicating the number of times the binary tree partitioningin the coding tree unit has been performed (i.e., 2 times), informationindicating the maximum depth which the binary tree partitioning has beenallowed in the coding tree unit (i.e., depth 3), or the number of depthsin which the binary tree partitioning has been performed in the codingtree unit (i.e., 2 (depth 2 and depth 3)) may be encoded/decoded througha bitstream.

As another example, at least one of information on the number of timesthe binary tree partitioning is permitted, the depth at which the binarytree partitioning is allowed, or the number of the depths at which thebinary tree partitioning is allowed may be obtained for each sequence oreach slice. For example, the information may be encoded in units of asequence, a picture, or a slice unit and transmitted through abitstream. Accordingly, at least one of the number of the binary treepartitioning in a first slice, the maximum depth in which the binarytree partitioning is allowed in the first slice, or the number of depthsin which the binary tree partitioning is performed in the first slicemay be difference from a second slice. For example, in the first slice,binary tree partitioning may be permitted for only one depth, while inthe second slice, binary tree partitioning may be permitted for twodepths.

As another example, the number of times the binary tree partitioning ispermitted, the depth at which the binary tree partitioning is allowed,or the number of depths at which the binary tree partitioning is allowedmay be set differently according to a time level identifier (TemporalID)of a slice or a picture. Here, the temporal level identifier(TemporalID) is used to identify each of a plurality of layers of videohaving a scalability of at least one of view, spatial, temporal orquality.

As shown in FIG. 4, the first coding block 300 with the partition depth(split depth) of k may be partitioned into multiple second coding blocksbased on the quad tree. For example, the second coding blocks 310 to 340may be square blocks having the half width and the half height of thefirst coding block, and the partition depth of the second coding blockmay be increased to k+1.

The second coding block 310 with the partition depth of k+1 may bepartitioned into multiple third coding blocks with the partition depthof k+2. Partitioning of the second coding block 310 may be performed byselectively using one of the quad tree and the binary tree depending ona partitioning method. Here, the partitioning method may be determinedbased on at least one of the information indicating quad tree-basedpartitioning and the information indicating binary tree-basedpartitioning.

When the second coding block 310 is partitioned based on the quad tree,the second coding block 310 may be partitioned into four third codingblocks 310 a having the half width and the half height of the secondcoding block, and the partition depth of the third coding block 310 amay be increased to k+2. In contrast, when the second coding block 310is partitioned based on the binary tree, the second coding block 310 maybe partitioned into two third coding blocks. Here, each of two thirdcoding blocks may be a non-square block having one of the half width andthe half height of the second coding block, and the partition depth maybe increased to k+2. The second coding block may be determined as anon-square block of a horizontal direction or a vertical directiondepending on a partitioning direction, and the partitioning directionmay be determined based on the information on whether binary tree-basedpartitioning is performed in a vertical direction or a horizontaldirection.

In the meantime, the second coding block 310 may be determined as a leafcoding block that is no longer partitioned based on the quad tree or thebinary tree. In this case, the leaf coding block may be used as aprediction block or a transform block.

Like partitioning of the second coding block 310, the third coding block310 a may be determined as a leaf coding block, or may be furtherpartitioned based on the quad tree or the binary tree.

In the meantime, the third coding block 310 b partitioned based on thebinary tree may be further partitioned into coding blocks 310 b-2 of avertical direction or coding blocks 310 b-3 of a horizontal directionbased on the binary tree, and the partition depth of the relevant codingblocks may be increased to k+3. Alternatively, the third coding block310 b may be determined as a leaf coding block 310 b-1 that is no longerpartitioned based on the binary tree. In this case, the coding block 310b-1 may be used as a prediction block or a transform block. However, theabove partitioning process may be limitedly performed based on at leastone of the information on the size/depth of the coding block that quadtree-based partitioning is allowed, the information on the size/depth ofthe coding block that binary tree-based partitioning is allowed, and theinformation on the size/depth of the coding block that binary tree-basedpartitioning is not allowed.

A number of a candidate that represent a size of a coding block may belimited to a predetermined number, or a size of a coding block in apredetermined unit may have a fixed value. As an example, the size ofthe coding block in a sequence or in a picture may be limited to have256×256, 128×128, or 32×32. Information indicating the size of thecoding block in the sequence or in the picture may be signaled through asequence header or a picture header.

As a result of partitioning based on a quad tree and a binary tree, acoding unit may be represented as square or rectangular shape of anarbitrary size.

As a result of a division based on the quadtree and the binary tree, acoding block which is not further partitioned can be used as aprediction block or a transform block. That is, in a QTBT partitioningmethod based on a quad tree and binary tree, a coding block may become aprediction block and a prediction block may become a transform block.For example, when the QTBT partitioning method is used, a predictionimage may be generated in a unit of a coding block, and a residualsignal, which is a difference between an original image and theprediction image, is transformed in a unit of a coding block. Here,generating the prediction image in a unit of a coding block may meanthat motion information is determined for a coding block or an intraprediction mode is determined for a coding block. Accordingly, a codingblock can be encoded using at least one of a skip mode, intraprediction, or inter prediction.

As another example, it is also possible to use a prediction block or atransform block having a smaller size than a coding block by dividingthe coding block.

In the QTBT partitioning method, it may be set that only symmetricpartitioning is allowed in BT. However, if only symmetric binarypartitioning is allowed even though an object and a background aredivided at a block boundary, coding efficiency may be lowered.Accordingly, in the present invention, a method of partitioning a codingblock asymmetrically is proposed in order to increase the codingefficiency.

Asymmetric binary tree partitioning represents dividing a coding blockinto two smaller coding blocks. As a result of the asymmetric binarytree partitioning, the coding block may be divided into two codingblocks of an asymmetric form. For convenience of explanation, in thefollowing embodiments, dividing a coding block into two partitions of asymmetrical form will be referred to as a binary tree partition (orbinary tree partitioning), and dividing a coding block into towpartitions of an asymmetric form will be referred to as an asymmetricbinary tree partition (or asymmetric binary tree partitioning).

FIG. 8 illustrates a partition type of a coding block based onasymmetric binary tree partitioning. A coding block of 2N×2N may bedivided into two coding blocks whose width ratio is n:(1−n) or twocoding blocks whose height ratio is n:(1−n). Where n may represent areal number greater than 0 and less than 1.

It is illustrated in FIG. 8 that two coding blocks whose width ratio is1:3 or 3:1 or whose height ratio is 1:3 or 3:1 are generated by applyingthe asymmetric binary tree partitioning to a coding block.

Specifically, as a coding block of W×H size is partitioned in a verticaldirection, a left partition whose width is ¼W and a right partitionwhose width is ¾W may be generated. As described above, a partition typein which the width of the left partition is smaller than the width ofthe right partition can be referred to as nL×2N binary partition.

As a coding block of W×H size is partitioned in a vertical direction, aleft partition whose width is ¾W and a right partition whose width is ¼Wmay be generated. As described above, a partition type in which thewidth of the right partition is smaller than the width of the leftpartition can be referred to as nR×2N binary partition.

As a coding block of W×H size is partitioned in a horizontal direction,a top partition whose width is ¼H and a bottom partition whose width is¾H may be generated. As described above, a partition type in which theheight of the top partition is smaller than the height of the bottompartition can be referred to as 2N×nU binary partition.

As a coding block of W×H size is partitioned in a horizontal direction,a top partition whose width is ¾H and a bottom partition whose width is¼H may be generated. As described above, a partition type in which theheight of the bottom partition is smaller than the height of the toppartition can be referred to as 2N×nD binary partition.

In FIG. 8, it is illustrated that a width ratio or a height ratiobetween two coding blocks is 1:3 or 3:1. However, the width ratio or theheight ratio between two coding blocks generated by asymmetric binarytree partitioning is not limited thereto. The coding block may bepartitioned into two coding blocks having different width ratio ordifferent height ratio from those shown in the FIG. 8.

When the asymmetric binary tree partitioning is used, an asymmetricbinary partition type of a coding block may be determined based oninformation signaled via a bitstream. For example, a partition type of acoding block may be determined based on information indicating apartitioning direction of the coding block and information indicatingwhether a first partition, generated by dividing the coding block, has asmaller size than a second partition.

The information indicating the partitioning direction of the codingblock may be a flag of 1 bit indicating whether the coding block ispartitioned in a vertical direction or in a horizontal direction. Forexample, hor_binary_flag may indicate whether the coding block ispartitioned in a horizontal direction. If a value of hor_binary_flag is1, it may indicate that the coding block is partitioned in thehorizontal direction and if the value of hor_binary_flag is 0, it mayindicate that the coding block is partitioned in the vertical direction.Alternatively, ver_binary_flag indicating whether or not the codingblock is partitioned in the vertical direction may be used.

The information indicating whether the first partition has a smallersize than the second partition may be a flag of 1 bit. For example,is_left_above_small_part_flag may indicate whether a size of a left ortop partition generated by dividing the coding block is smaller than aright or bottom partition. If a value of is_left_above_small_part_flagis 1, it means that the size of the left or top partition is smallerthan the right or bottom partition. If the value ofis_left_above_small_part_flag is 0, it means that the size of the leftor top partition is larger than the right or bottom partition.Alternatively, is_right_bottom_small_part_flag indicating whether thesize of the right or bottom partition is smaller than the left or toppartition may be used.

Alternatively, sizes of a first partition and a second partition may bedetermined by using information indicating a width ratio, a height ratioor an area ratio between the first partition and the second partition.

When a value of hor_binary_flag is 0 and a value ofis_left_above_small_part_flag is 1, it may represent nL×2N binarypartition, and when a value of hor_binary_flag is 0 and a value ofis_left_above_small_part_flag is 0, it may represent nR×2N binarypartition. In addition, whan a value of hor_binary_flag is 1 and a valueof is_left_above_small_part_flag is 1, it may represent 2N×nU binarypartition, and when a value of hor_binary_flag is 1 and a value ofis_left_above_small_part_flag is 0, it may represent 2N×nD binarypartition.

As another example, the asymmetric binary partition type of the codingblock may be determined by index information indicating a partition typeof the coding block. Here, the index information is information to besignaled through a bitstream, and may be encoded with a fixed length(i.e., a fixed number of bits) or may be encoded with a variable length.For example, Table 1 below shows the partition index for each asymmetricbinary partition.

TABLE 1 Asymmetric partition index Binarization nLx2N 0 0 nRx2N 1 102NxnU 2 100 2NxnD 3 111

Asymmetric binary tree partitioning may be used depending on the QTBTpartitioning method. For example, if the quadtree partitioning or thebinary tree partitioning is no longer applied to the coding block, itmay be determined whether or not to apply asymmetric binary treepartitioning to the coding block. Here, whether or not to apply theasymmetric binary tree partitioning to the coding block may bedetermined by information signaled through the bitstream. For example,the information may be a 1 bit flag ‘asymmetric_binary_tree_flag’, andbased on the flag, it may be determined whether the asymmetric binarytree partitioning is to be applied to the coding block.

Alternatively, when it is determined that the coding block ispartitioned into two blocks, it may be determined whether the partitiontype is binary tree partitioning or asymmetric binary tree partitioning.Here, whether the partition type of the coding block is the binary treepartitioning or the asymmetric binary tree partitioning may bedetermined by information signaled through the bitstream. For example,the information may be a 1 bit flag ‘is_asymmetric_split_flag’, andbased on the flag, it may be determined whether the coding block is tobe partitioned into a symmetric form or an asymmetric from.

As another example, indexes assigned to symmetric type binary partitionsand to asymmetric type binary partitions may be different, and it may bedetermined based on index information whether the coding block is to bepartitioned in a symmetric type or an asymmetric type. For example,Table 2 shows an example in which different indexes are assigned tosymmetric binary type partitions and asymmetric binary type partitions.

TABLE 2 Binary partition index Binarization 2NxN (Binary 0 0 partitionin horizontal direction) Nx2N (Binary 1 10 partition in verticaldirection) nLx2N 2 110 nRx2N 3 1110 2NxnU 4 11110 2NxnD 5 11111

A coding tree block or a coding block may be divided into a plurality ofcoding blocks by quad tree partitioning, binary tree partitioning orasymmetric binary tree partitioning. For example, FIG. 8 shows anexample in which a coding block is divided into a plurality of codingblocks using QTBT and asymmetric binary tree partitioning. Referring toFIG. 9, it can be seen that the asymmetric binary tree partitioning isperformed in depth 2 partitioning in the first drawing, depth 3partitioning in the second drawing, and depth 3 partitioning in thethird drawing, respectively.

It may be restricted that a coding block divided by the asymmetricbinary tree partitioning is no longer divided. For example, informationrelated to a quadtree, binary tree, or asymmetric binary tree may not beencoded/decoded for a coding block which is generated by the asymmetricbinary tree partitioning. That is, for a coding block generated throughthe asymmetric binary tree partitioning, a flag indicating whetherquadtree partitioning is applied, a flag indicating whether binary treepartitioning is applied, a flag indicating whether asymmetric binarytree partitioning is applied, a flag indicating a direction of thebinary tree partitioning or the asymmetric binary tree partitioning, orindex information indicating an asymmetric binary partition, or the likemay be omitted.

As another example, whether or not to allow the binary tree partitioningmay be determined depending on whether the QTBT is allowed or not. Forexample, in a picture or slice in which the QTBT-based partitioningmethod is not used, it may be restricted not to use the asymmetricbinary tree partitioning.

Information indicating whether the asymmetric binary tree partitioningis allowed may be encoded and signaled in a unit of a block, a slice ora picture. Here, the information indicating whether the asymmetricbinary tree partitioning is allowed may be a flag of 1 bit. For example,if a value of is_used_asymmetric_QTBT_enabled_flag is 0, it may indicatethat the asymmetric binary tree partitioning is not used. It is alsopossible that is_used_asymmetric_QTBT_enabled_Flag is set to 0 withoutsignaling thereof when the binary tree partitioning is not used in apicture or a slice.

It is also possible to determine a partition type allowed in a codingblock based on a size, a shape, a partition depth, or a partition typeof the coding block. For example, at least one of partition types,partition shapes or a number of partitions allowed in a coding blockgenerated by the quad tree partitioning and in a coding block generatedby the binary tree partitioning may be different from each other.

For example, if a coding block is generated by the quadtreepartitioning, all of the quadtree partitioning, the binary treepartitioning, and the asymmetric binary tree partitioning may be allowedfor the coding block. That is, if a coding block is generated based onquad tree partitioning, all partition types shown in FIG. 10 can beapplied to the coding block. For example, a 2N×2N partition mayrepresent a case where a coding block is not further divided, N×N mayrepresent a case where a coding block is partitioned in a quad-tree, andN×2N and 2N×N may represent a case where a coding block is partitionedin a binary tree. In addition, nL×2N, nR×2N, 2N×nU, and 2N×nD mayrepresent cases where a coding block is partitioned in an asymmetricbinary tree.

On the other hand, when a coding block is generated by the binary treepartitioning, it may not be allowed to use the asymmetric binary treepartitioning for the coding block. That is, when the coding block isgenerated based on the binary tree partitioning, it may be restrictednot to apply the asymmetric partition type (nL×2N, nR×2N, 2N×nU, 2N×nD)among the partition types shown in FIG. 10 to the coding block.

As described in the above example, a coding unit (or a coding tree unit)can be recursively divided by at least one vertical or horizontal line.For example, it can be summarized that quad tree partitioning is amethod of dividing a coding block using a horizontal line and a verticalline, and a binary tree partitioning is a method of dividing a codingblock using a horizontal line or a vertical line. A partition type of acoding block based on the quad tree partitioning and the binary treepartitioning is not limited to the example shown in FIG. 4 to FIG. 10,and an extended partition type other than the illustrated types can beused. That is, a coding block may be recursively divided in a typedifferent from that shown in FIGS. 4 to 10. Hereinafter, variouspartition types of the coding block based on quad tree partitioning andbinary tree partitioning will be described.

When a current block is quad tree partitioned, at least one of ahorizontal line or a vertical line may divide the coding blockasymmetrically. Here, asymmetry may mean that heights of blocks dividedby a horizontal line are not the same or widths of blocks divided by avertical line are not the same. For example, a horizontal line maydivide a coding block into asymmetrical shapes while a vertical linedivides the coding block into symmetric shapes, or a horizontal line maydivide a coding block into symmetrical shapes while a vertical linedivides the coding block into asymmetric shapes. Alternatively, both thehorizontal line and the vertical line may divide a coding blockasymmetrically.

FIG. 11 is a diagram illustrating quad tree partition types of a codingblock. In FIG. 11, a first example shows an example in which both ahorizontal line and a vertical line are used for symmetric partitioning.A second example and a third example show examples in which a horizontalline is used for symmetric partitioning whereas a vertical line is usedfor asymmetric partitioning. A fourth example and a fifth example showexamples in which a vertical line is used for symmetric partitioningwhile a horizontal line is used for asymmetric partitioning.

In order to specify a partition type of a coding block, informationrelated to the partition type of the coding block may be encoded. Here,the information may include a first indicator indicating whether apartition type of a coding block is symmetric or asymmetric. The firstindicator may be encoded in a unit of a block, or may be encoded foreach vertical line or each horizontal line. For example, the firstindicator may include information indicating whether a vertical line isto be used for symmetric partitioning and information indicating whethera horizontal line is to be used for symmetric partitioning.

Alternatively, the first indicator may be encoded only for a verticalline or a horizontal line, and a partition type of another line forwhich the first indicator is not encoded may be derived dependently bythe first indicator. For example, the partition type of another line forwhich the first indicator is not encoded may have a value opposite tothat of the first indicator. That is, if the first indicator indicatesthat a vertical line is used for asymmetric partitioning, it may be setto use a horizontal line for symmetric partitioning opposite to thefirst indicator.

It is also possible to further encode a second indicator for a verticalline or a horizontal line when the first indicator indicates asymmetricpartitioning. Here, the second indicator may indicate at least one of aposition of a vertical line or a horizontal line used for asymmetricpartitioning or a ratio between blocks divided by the vertical line orthe horizontal line.

Quad tree partitioning may be performed using a plurality of verticallines or a plurality of horizontal lines. For example, it is alsopossible to divide a coding block into four blocks by combining at leastone of one or more vertical lines or one or more horizontal lines.

FIG. 12 is a diagram showing an example of dividing a coding block bycombining a plurality of vertical lines/horizontal lines and onehorizontal line/vertical line.

Referring to FIG. 12, quad tree partitioning is performed by dividing acoding block into three blocks by two vertical lines or two horizontallines, and then dividing one of the three divided blocks into twoblocks. At this time, as in the example shown in FIG. 12, a blocklocated in a center among the blocks divided by two vertical lines ortwo horizontal lines can be divided by a horizontal line or a verticalline. It is also possible to divide a block located at one side of thecoding block by using a horizontal or a vertical line. Alternatively,information (e.g., a partition index) for specifying a partition to bedivided among the three partitions may be signaled through a bitstream.

At least one of a horizontal line or a vertical line may be used todivide a coding block asymmetrically, and the other may be used todivide the coding block symmetrically. For example, a plurality ofvertical lines or a plurality of horizontal lines may be used to dividea coding block into symmetric shapes, or one horizontal line or onevertical line may be used to divide the coding block into symmetricshapes. Alternatively, both horizontal line and vertical line may beused to divide the coding block into symmetric shapes, or may be used todivide the coding block into asymmetric shapes.

When combining a plurality of vertical lines/horizontal lines and onehorizontal line/one vertical line, the coding block can be divided intofour partitions (i.e., four coding blocks) composed of at least twodifferent sizes. A method of dividing a coding block into fourpartitions having at least two different sizes can be referred to astriple type asymmetric quad tree partitioning (Triple Type AsymmetricQuad-tree CU partitioning).

Information on the triple asymmetric quad tree partitioning may beencoded based on at least one of the first indicator or the secondindicator described above. For example, the first indicator may indicatewhether a partition type of a coding block is symmetric or asymmetric.The first indicator may be encoded in a unit of a block, or may beencoded each for a vertical line or a horizontal line. For example, thefirst indicator may include information indicating whether one or morevertical lines are to be used for symmetric partitioning and informationindicating whether one or more horizontal lines are to be used forsymmetric partitioning.

Alternatively, the first indicator may be encoded only for a verticalline or a horizontal line, and a partition type of another line forwhich the first indicator is not encoded may be derived by the firstindicator.

It is also possible to further encode the second indicator for avertical line or a horizontal line when the first indicator indicatesasymmetric partitioning. Here, the second indicator may indicate atleast one of a position of a vertical line or a horizontal line used forasymmetric partitioning or a ratio between blocks divided by a verticalline or a horizontal line.

A binary tree partitioning method in which the coding block is dividedinto a rectangular shaped partition and a non-rectangular shapedpartition may be used. The binary tree partitioning method in which acoding block is recursively divided into a rectangular block and anon-rectangular block can be referred to as a polygonal binary treepartitioning (Polygon Binary Tree CU Partitioning).

FIG. 13 is a diagram illustrating partition types according to polygonalbinary tree partitioning.

As in the example illustrated in FIG. 13, when a coding block is dividedbased on polygonal binary tree partitioning, the coding block can bedivided into a square-shaped partition and a polygonal-shaped partition.

A partition type of a coding block may be determined based on an indexspecifying the partition type. For example, a partition type of a codingblock may be determined based on index information indicating any one ofPoly 0 to Poly 3 shown in FIG. 13.

Alternatively, a partition type of a coding block may be determinedbased on information specifying a position of a square block in thecoding block. For example, when position information indicates that asquare block in a coding block is located at a top-left from a center ofthe coding block, a partition type of the coding block may be determinedas Poly 0 shown in FIG. 13.

It is also possible to generate a polygonal partition by merging aplurality of previously divided coding blocks. For example, when acoding block of 2N×2N type is divided into four sub-coding blocks of N×Ntype, it is possible to generate a polygonal type partition by mergingany one of four sub-coding blocks and sub-coding blocks adjacent to thesub-coding block. Alternatively, when a coding block of 2N×2N type isdivided into two sub-coding blocks of N×N type and one sub-coding blockof 2N×N or N×2N type, a polygonal type partition may be generated bymerging a sub-coding block of N×N type and the sub-coding block of 2N×Nor N×2N type.

When a current coding block is divided based on polygonal binary treepartitioning, an index indicating a partition type of the current codingblock or information indicating a position of a square block in thecurrent coding block may be signaled, or information to construct apolygonal shaped partition in the current coding block may be signaled.Here, the information for constructing the polygonal shaped partitionmay include at least one of information indicating whether or not adivided block is to be merged with neighboring blocks, informationregarding a position of a block and/or the number of blocks to bemerged. The information for specifying the partition type may besignaled through at least one of a video parameter set, a sequenceparameter set, a picture parameter set, a slice header, or a block levelaccording to characteristics.

A divided coding block generated based on polygonal binary treepartitioning may be restricted so as not to be further divided.Alternatively, only a specific type of partitioning may be allowed for adivided coding block generated based on polygonal binary treepartitioning.

Information on whether polygonal binary tree partitioning is allowed maybe signaled through at least one of a video parameter set, a sequenceparameter set, a picture parameter set, a slice header, or a blocklevel. For example, through a sequence header, a syntaxisUsePolygonBinaryTreeFlag indicating whether polygonal binary treepartitioning is allowed may be signaled. If isUsePolygonBinaryTreeFlagis equal to 1, coding blocks in a current sequence can be divided basedon polygonal binary tree partitioning.

Whether or not polygonal binary tree partitioning is to be used may bedetermined depending on whether or not binary tree partitioning is to beused. For example, if binary tree partitioning is not allowed (e.g., ifisUseBinaryTreeFlag is 0), then polygonal binary tree partitioning maynot be allowed. On the other hand, if binary tree partitioning isallowed, it may be determined whether polygonal binary tree partitioningis to be used according to a syntax of isUsePolygonBinaryTreeFlagindicating whether or not the polygonal binary tree partitioning to beis allowed.

A partition index of partitions generated by polygonal binary treepartitioning may be determined according to locations of partitions. Forexample, a partition including a predetermined location may have apartition index precede to a partition which does not including thepredetermined location. For example, as in the example shown in FIG. 13,it may be set that a partition including a position of a top left sampleof a coding block may have partition index 0, and the other partitionmay have partition index 1. Alternatively, a partition index of eachpartition may be determined according to a size of the partition.

When a coding block is divided by polygonal binary tree partitioning, anencoding/decoding order of each partition may follow a partition index.That is, after encoding partition 0 firstly, partition 1 can be encodedin a next order. Alternatively, the partition 0 and the partition 1 maybe encoded/decoded in parallel.

At this time, in case of performing a prediction for a polygonalpartition, it is possible to divide the polygonal partition intosub-partitions and the prediction can be performed in a unit of asub-partition.

FIG. 14 is a diagram illustrating an example in which a polygonalpartition is divided into sub-partitions.

When intra prediction is performed on a polygonal partition, thepolygonal partition may be divided into sub-blocks in a shape of arectangle, as in the example shown in FIG. 14. The polygonal partitionmay be divided into a square shaped partition and a non-square shapedpartition, as in the example shown in FIG. 14, or may be divided intosquare shaped partitions though not shown in the drawing.

When a polygonal partition is divided into a plurality of partitions,intra prediction may be performed on each of the divided partitions. Forexample, in the example shown in FIG. 14, intra prediction may beperformed on each of Pred 0 and Pred 1.

Intra prediction modes of Pred 0 and Pred 1 may be determineddifferently, but reference samples of each partition may be derivedbased on a polygonal partition or a coding block. Alternatively, it mayderive an intra prediction mode of Pred 1 based on an intra predictionmode of Pred 0, or may derive an intra prediction mode of Pred 0 basedon an intra prediction mode of Pred 1.

The asymmetric quad tree partitioning, the polygonal type binary treepartitioning, and the like described above can be defined as extendedtypes of quadtree partitioning and binary tree partitioning. Whether ornot an extended partition type is to be used can be determined in asequence unit, a picture unit, a slice unit, or a block level, or it canbe determined depending on whether quad tree partitioning is allowed orwhether binary tree partitioning is allowed.

In the above example, it is assumed that a coding block is divided intofour or two partitions. However, it is also possible to recursivelydivide a coding block into a larger number of partitions or a fewernumber of partitions. For example, the number of vertical lines orhorizontal lines may be adjusted and a coding block may be divided intotwo partitions or three partitions using only vertical line(s) orhorizontal line(s). For example, if one horizontal line or one verticalline is used, a coding block may be divided into two partitions. At thistime, depending on whether or not a size of each partition is the same,it can be determined whether a partition type of the coding block is anasymmetric binary partition or a symmetric binary partition. As anotherexample, a coding block may be partitioned into three partitions byusing two vertical lines or two horizontal lines. Dividing a codingblock into three partitions using two vertical lines or two horizontallines can be referred to as triple tree partitioning.

FIG. 15 shows an example in which a coding block is partitioned based ona triple tree. As in the example shown in FIG. 15, as the coding blockis divided by two horizontal lines or two vertical lines, threepartitions can be generated.

Coding blocks generated by triple tree partitioning may be furtherdivided into sub-coding blocks, or may be further divided into smallerunits for prediction or transform.

In another example, a coding block generated by triple tree partitioningmay be restricted so as not to be further divided. Alternatively, acoding block generated by triple tree partitioning may be restrictedsuch that some of quad tree partitioning, triple tree partitioning, orbinary tree partitioning is not applied.

Depending on a size or a shape of a coding block, it may be determinedwhether triple tree partitioning is allowed. For example, triple treepartitioning can be limitedly allowed when a size of a coding block isM×N. Here, N and M are natural numbers and N and M may be the same ormay be different from each other. For example, N and M may have valuesof 4, 8, 16, 32, 64, or more.

Information indicating a size or a shape of a block for which tripletree partitioning is allowed may be encoded and transmitted through thebitstream. At this time, the information may represent a maximum valueor a minimum value. Alternatively, a size or a shape of a block forwhich triple tree partitioning is allowed may have a fixed valuepre-agreed in the encoder/decoder.

Information indicating whether triple tree partitioning is allowed maybe signaled in a unit of a picture, a slice, or a block. Informationindicating whether the triple tree partitioning is to be applied may besignaled to a block included in the predetermined unit only when theinformation indicates that the triple tree partitioning for thepredetermined unit is allowed.

The information indicating whether the triple tree partitioning is to beapplied may be a flag of 1 bit. For example, triple_split_flag mayindicate whether a current coding block is to be divided based on atriple tree. When the current coding block is divided based on thetriple tree, information indicating a partitioning direction orinformation indicating a size/ratio of each partition can beadditionally signaled. The information indicating the partitioningdirection may be used to determine whether a coding block is to bedivided by two horizontal lines or whether a coding block is to bedivided by two vertical lines.

When a coding block is divided based on a triple tree, partitionsincluded in the coding block may share motion information, a mergecandidate, reference samples, or an intra prediction mode according to asize or a shape of the coding block. For example, if a current codingblock is divided based on triple tree partitioning and a size or a shapeof the current coding block satisfies a predetermined condition, codingblocks in the current coding block may share at least one of a spatialneighboring block candidate or a temporal neighboring block candidatefor inter prediction, reference samples or an intra prediction mode forintra prediction. Alternatively, only some of coding blocks in thecurrent coding block may share the information, and remaining codingblocks may do not share the information.

The method of dividing a coded block using at least one of quad treepartitioning, binary tree partitioning, or triple tree partitioning maybe referred to as multi-tree partitioning. Under the multi-treepartitioning method, a coding unit can be divided into a plurality ofpartitions using at least one of quad tree partitioning, binary treepartitioning, or triple tree partitioning. Each partition generated bydividing a coding block can be defined as a coding unit.

FIG. 16 and FIG. 17 illustrate partition types of a coding blockaccording to a multi-tree partitioning method. Nine partition typesaccording to quad tree partitioning, binary partitioning, and tripletree partitioning are illustrated in FIG. 16.

If polygonal type binary tree partitioning is included in a category ofthe multi-tree partitioning, a coding block may be divided into aplurality of partitions based on at least one of quad tree partitioning,binary tree partitioning, triple tree partitioning and polygonal typebinary tree partitioning. Thus, a coding block may have a partition typeas in the example illustrated in FIG. 17.

Only a predefined partition type, illustrated in examples in FIG. 16 orFIG. 17, can be set to be available under the multi-tree partitioningmethod. However, the predefined partition type is not limited to theexamples shown in FIG. 16 or FIG. 17.

Under the multi-tree partitioning method, whether to use each of quadtree partitioning, binary tree partitioning, and triple treepartitioning may be determined in a unit of a sequence, a picture, or aslice. For example, whether to use quad tree partitioning, binary treepartitioning, and triple tree partitioning can be determined based onflag information indicating whether or not each partitioning method isto be used. In accordance with the determination, blocks included in apredetermined unit (i.e., a sequence, a picture, a slice, or the like)may be partitioned using all of the quad tree partitioning, the binarytree partitioning, and the triple tree partitioning, or blocks includedin the predetermined unit may be partitioned using one or two of thequad tree partitioning, binary tree partitioning and the triple treepartitioning.

Alternatively, some of quad tree partitioning, binary tree partitioning,and triple tree partitioning may be used as defaults, and whether to usethe remaining partitioning methods may be selectively determined. Forexample, quad tree partitioning is used as default, but whether to usebinary tree partitioning or triple tree partitioning may be selectivelydetermined. Or, quad tree partitioning and triple tree partitioning areused as defaults, but whether to use binary tree partitioning may beselectively determined. Or, quad tree partitioning and binary treepartitioning are used as defaults, but whether or not to use triple treepartitioning may be selectively determined.

An indicator indicating whether to use a binary tree partitioning methodor a triple tree partitioning method may be a flag of 1 bit. Forexample, isUseBinaryTreeFlag indicates whether binary tree partitioningis to be used, and isUseTripleTreeFlag indicates whether triple treepartitioning is to be used.

The indicator may be signaled through a sequence header. For example, ifa value of isUseBinaryTreeFlag is 1, binary tree partitioning may beused for coding units in a current sequence. Alternatively, if a valueof isUseTripleTreeFlag is 1, triple tree partitioning may be used forcoding units in a current sequence. Beyond the above example, theindicator may be signaled via a video parameter set, a picture parameterset, a slice header, or a block level.

A partition type of a current coding block may be restricted so as notto generate a larger number of partitions than a partition type of anupper node. For example, if a current coding block is generated bytriple tree partitioning, only triple tree partitioning or binary treepartitioning is allowed for the current coding block, and quad treepartitioning is not allowed for the current coding block.

In addition, information indicating whether or not a current codingblock is to be divided may be hierarchically encoded/decoded accordingto the number of partitions generated as a result of partitioning. Forexample, information indicating whether a current coding block is to bedivided based on a quad tree is encoded/decoded, and if it is determinedthat the current block is not divided based on the quad tree, theninformation whether to divide based on a triple tree or informationwhether to divide based on a binary tree may be encoded/decoded.

It is also possible to divide a coding block into four or more blocks bycombining a plurality of horizontal lines and a plurality of verticallines instead of examples described above.

FIG. 18 is a flowchart illustrating partitioning processes of a codingblock according to an embodiment of the present invention.

First, it may be determined whether quad tree partitioning is performedon a current block S1810. If it is determined that quad treepartitioning is to be performed on the current block, the current blockmay be divided into four coding blocks S1820.

In dividing the current block into four blocks, processes of FIG. 19 maybe additionally performed to determine a partition type of the currentblock.

First, in dividing a current block into four coding blocks, it may bedetermined whether or not triple type asymmetric quad tree partitioningis to be applied to the current block S1910. If the triple typeasymmetric quad tree partitioning is applied to the current block, apartition type of the current block may be determined based on thenumber or a location of vertical lines/horizontal lines dividing thecurrent block S1920. For example, if the triple type asymmetric quadtree partitioning is applied to the current block, the current block maybe divided into four partitions by two vertical lines and one horizontalline, or two horizontal lines and one vertical line.

If the triple type asymmetric quad tree partitioning is not applied, itmay be determined whether a partition type of the current block is asquare type or a non-square type S1930. Here, whether or not thepartition type of the current block is the square type or the non-squaretype may be determined based on whether at least one of a vertical lineand a horizontal line dividing the current block divides the currentblock symmetrically. If the current block is divided into the non-squaretype, the partition type of the current block may be determined based ona position of the vertical line/horizontal line dividing the currentblock S1940.

On the other hand, if it is determined that the quad tree partitioningis not allowed for the current block, it may be determined whether treetree partitioning or binary tree partitioning is performed on thecurrent block S1830.

If it is determined that the triple tree partitioning or the binary treepartitioning is performed for the current block, a partition type of thecurrent block may be determined. At this time, the triple tree partitiontype or the binary tree partition type of the current block may bedetermined based on at least one of information indicating apartitioning direction of the current block, or index informationspecifying a partition type.

The current block may be divided into three or two blocks according tothe determined triple tree or binary partition type S1840.

In the above-described example, it is illustrated that it is selectivelydetermined whether to apply the triple tree partitioning or the binarytree partitioning after determination of whether to apply the quad treepartitioning, but the present invention is not limited to theillustrated embodiment. Unlike the illustrated example, it is alsopossible to hierarchically determine whether to apply the triple treepartitioning or whether to apply the binary tree partitioning. Forexample, it may be determined in advance whether the current block is tobe divided based on a triple tree and if it is determined that thecurrent block is not divided based on the triple tree, thendetermination of whether or not the current block is to be divided basedon a binary tree is performed. Alternatively, it is possible topreferentially determine whether or not the current block is to bedivided based on the binary tree and if it is determined that thecurrent block is not divided based on the binary tree, thendetermination of whether or not the current block is to be divided basedon the triple tree may be performed.

In dividing the current block into two blocks, processes of FIG. 20 maybe additionally performed to determine a partition type of the currentblock.

First, in dividing the current block into two coding blocks, it may bedetermined whether or not polygonal binary tree partitioning is to beapplied to the current block S2010. If the polygonal binary treepartitioning is applied to the current block, a partition type of thecurrent block may be determined based on an index indicating thepartition type of the current block or a location of a partition of arectangular shape S2020. For example, if the polygonal binary treepartitioning is applied to the current block, the current block may bepartitioned into one rectangular shaped partition and onenon-rectangular shaped partition.

If the polygonal binary tree partitioning is not applied, it may bedetermined whether the partition type of the current block is a squaretype or a non-square type S2030. Here, whether or not the partition typeof the current block is the square type or the non-square type may bedetermined by whether at least one of a vertical line or a horizontalline dividing the current block divides the current block into asymmetrical form. If the current block is divided into non-squareblocks, the partition type of the current block may be determined basedon the position of the vertical line or the horizontal line dividing thecurrent block S2040.

As an example illustrated in FIG. 20, it is also possible tosequentially determine whether or not binary tree partitioning isperformed for the current block and whether or not asymmetric binarytree partitioning is performed for the current block. For example, itcan be determined whether or not to perform asymmetric binary treepartitioning only when it is determined that the binary treepartitioning is not allowed to the current block.

The above description has been made on the case where the coding blockis recursively divided through quad tree partitioning, binary treepartitioning, or triple tree partitioning. The described partitioningmethod may be applied to divide a coding block into prediction blocks ortransform blocks, or may be applied to divide a prediction block or atransform block recursively. For example, a coding block may be dividedinto a plurality of prediction blocks or a plurality of transform blocksthrough quad tree partitioning, binary tree partitioning, or triple treepartitioning.

FIG. 21 is a flowchart illustrating processes of obtaining a residualsample according to an embodiment to which the present invention isapplied.

First, a residual coefficient of a current block may be obtained S2110.A decoder may obtain a residual coefficient through a coefficientscanning method. For example, the decoder may perform a coefficient scanusing a diagonal scan, a jig-zag scan, an up-right scan, a verticalscan, or a horizontal scan, and may obtain residual coefficients in aform of a two-dimensional block.

An inverse quantization may be performed on the residual coefficient ofthe current block S2120.

It is possible to determine whether to skip an inverse transform on thedequantized residual coefficient of the current block S2130.Specifically, the decoder may determine whether to skip the inversetransform on at least one of a horizontal direction or a verticaldirection of the current block. When it is determined to apply theinverse transform on at least one of the horizontal direction or thevertical direction of the current block, a residual sample of thecurrent block may be obtained by inverse transforming the dequantizedresidual coefficient of the current block S1240. Here, the inversetransform can be performed using at least one of DCT, DST, and KLT.

When the inverse transform is skipped in both the horizontal directionand the vertical direction of the current block, inverse transform isnot performed in the horizontal direction and the vertical direction ofthe current block. In this case, the residual sample of the currentblock may be obtained by scaling the dequantized residual coefficientwith a predetermined value S2150.

Skipping the inverse transform on the horizontal direction means thatthe inverse transform is not performed on the horizontal direction butthe inverse transform is performed on the vertical direction. At thistime, scaling may be performed in the horizontal direction.

Skipping the inverse transform on the vertical direction means that theinverse transform is not performed on the vertical direction but theinverse transform is performed on the horizontal direction. At thistime, scaling may be performed in the vertical direction.

It may be determined whether or not an inverse transform skip techniquemay be used for the current block depending on a partition type of thecurrent block. For example, if the current block is generated through abinary tree-based partitioning, the inverse transform skip scheme may berestricted for the current block. Accordingly, when the current block isgenerated through the binary tree-based partitioning, the residualsample of the current block may be obtained by inverse transforming thecurrent block. In addition, when the current block is generated throughbinary tree-based partitioning, encoding/decoding of informationindicating whether or not the inverse transform is skipped (e.g.,transform_skip_flag) may be omitted.

Alternatively, when the current block is generated through binarytree-based partitioning, it is possible to limit the inverse transformskip scheme to at least one of the horizontal direction or the verticaldirection. Here, the direction in which the inverse transform skipscheme is limited may be determined based on information decoded fromthe bitstream, or may be adaptively determined based on at least one ofa size of the current block, a shape of the current block, or an intraprediction mode of the current block.

For example, when the current block is a non-square block having a widthgreater than a height, the inverse transform skip scheme may be allowedonly in the vertical direction and restricted in the horizontaldirection. That is, when the current block is 2N×N, the inversetransform is performed in the horizontal direction of the current block,and the inverse transform may be selectively performed in the verticaldirection.

On the other hand, when the current block is a non-square block having aheight greater than a width, the inverse transform skip scheme may beallowed only in the horizontal direction and restricted in the verticaldirection. That is, when the current block is N×2N, the inversetransform is performed in the vertical direction of the current block,and the inverse transform may be selectively performed in the horizontaldirection.

In contrast to the above example, when the current block is a non-squareblock having a width greater than a height, the inverse transform skipscheme may be allowed only in the horizontal direction, and when thecurrent block is a non-square block having a height greater than awidth, the inverse transform skip scheme may be allowed only in thevertical direction.

Information indicating whether or not to skip the inverse transform withrespect to the horizontal direction or information indicating whether toskip the inverse transformation with respect to the vertical directionmay be signaled through a bitstream. For example, the informationindicating whether or not to skip the inverse transform on thehorizontal direction is a 1-bit flag, ‘hor_transform_skip_flag’, andinformation indicating whether to skip the inverse transform on thevertical direction is a 1-bit flag, ‘ver_transform_skip_flag’. Theencoder may encode at least one of ‘hor_transform_skip_flag’ or‘ver_transform_skip_flag’ according to the shape of the current block.Further, the decoder may determine whether or not the inverse transformon the horizontal direction or on the vertical direction is skipped byusing at least one of “hor_transform_skip_flag” or“ver_transform_skip_flag”.

It may be set to skip the inverse transform for any one direction of thecurrent block depending on a partition type of the current block. Forexample, if the current block is generated through a binary tree-basedpartitioning, the inverse transform on the horizontal direction orvertical direction may be skipped. That is, if the current block isgenerated by binary tree-based partitioning, it may be determined thatthe inverse transform for the current block is skipped on at least oneof a horizontal direction or a vertical direction withoutencoding/decoding information (e.g., transform_skip_flag,hor_transform_skip_flag, ver_transform_skip_flag) indicating whether ornot the inverse transform of the current block is skipped.

Although the above-described embodiments have been described on thebasis of a series of steps or flowcharts, they do not limit thetime-series order of the invention, and may be performed simultaneouslyor in different orders as necessary. Further, each of the components(for example, units, modules, etc.) constituting the block diagram inthe above-described embodiments may be implemented by a hardware deviceor software, and a plurality of components. Or a plurality of componentsmay be combined and implemented by a single hardware device or software.The above-described embodiments may be implemented in the form ofprogram instructions that may be executed through various computercomponents and recorded in a computer-readable recording medium. Thecomputer-readable recording medium may include one of or combination ofprogram commands, data files, data structures, and the like. Examples ofcomputer-readable media include magnetic media such as hard disks,floppy disks and magnetic tape, optical recording media such as CD-ROMsand DVDs, magneto-optical media such as floptical disks, media, andhardware devices specifically configured to store and execute programinstructions such as ROM, RAM, flash memory, and the like. The hardwaredevice may be configured to operate as one or more software modules forperforming the process according to the present invention, and viceversa.

INDUSTRIAL APPLICABILITY

The present invention may be applied to electronic devices which is ableto encode/decode a video.

1-15. (canceled)
 16. A method of decoding a video, the methodcomprising: obtaining a prediction sample of a current block;determining whether it is allowed to divide the current block into twopartitions or not; when it is determined that a division of the currentblock is allowed, determining whether to divide the current block intotwo partitions or not; when it is determined that the current block isto be divided, decoding a first indicator of 1-bit indicating whetherthe current block is partitioned in a symmetric form or in an asymmetricform; dividing the current block in a vertical direction or in ahorizontal direction so as to generate two partitions; performing aninverse-transform for one of the two partitions; and obtaining areconstruction sample based on a residual sample obtained based on theinverse-transform and the prediction sample, wherein when the firstindicator indicates that the current block is partitioned in theasymmetric form, the current block is partitioned into a first partitionhaving ¼ size of the current block and a second partition having ¾ sizeof the current block, and wherein locations of the first partition andthe second partition are determined based on a second indicator of 1-bitdecoded from a bitstream.
 17. The method of claim 16, wherein when thecurrent block is divided in the horizontal direction, it is determinedbased on the second indicator which of the first partition and thesecond partition is located upper side of the current block, and whenthe current block is divided in the vertical direction, it is determinedbased on the second indicator which of the first partition and thesecond partition is located left side of the current block.
 18. Themethod of claim 16, wherein it is determined based on a size of thecurrent block whether both of the symmetric form and the asymmetric formare applicable to the current block or only the symmetric form isapplicable to the current block.
 19. The method of claim 16, whereinwhether the division of the current block is allowed or not isdetermined based on an enabled flag.
 20. The method of claim 16, whereinthe prediction sample is obtained by performing inter prediction.
 21. Amethod of encoding a video, the method comprising: obtaining aprediction sample of a current block; determining whether it is allowedto divide the current block into two partitions or not; when itdetermined that a division of the current block is allowed, determiningwhether to divide the current block into two partitions or not; when itis determined to divide the current block, determining whether thecurrent block is partitioned in a symmetric form or in an asymmetricform, a first indicator of 1-bit indicating whether the current block ispartitioned in the symmetric form or in the asymmetric form beingencoded in a bitstream; dividing the current block in a verticaldirection or in a horizontal direction so as to generate two partitions;performing an inverse-transform for one of the two partitions; andobtaining a reconstruction sample based on a residual sample obtainedbased on the inverse-transform and the prediction sample, wherein whenit is determined to divide the current block in the asymmetric form, thecurrent block is partitioned into a first partition having a ¼ size ofthe current block and a second partition having ¾ size of the currentblock, and wherein a second indicator of 1-bit which is used todetermine locations of the first partition and the second partition isencoded in the bitstream.
 22. The method of claim 21, wherein when thecurrent block is divided in the horizontal direction, the secondindicator is used to determine which of the first partition and thesecond partition is located upper side of the current block, and whenthe current block is divided in the vertical direction, the secondindicator is used to determine which of the first partition and thesecond partition is located left side of the current block.
 23. Themethod of claim 21, wherein it is determined based on a size of thecurrent block whether both of the symmetric form and the asymmetric formare applicable to the current block or only the symmetric form isapplicable to the current block.
 24. The method of claim 21, wherein themethod further comprises encoding an enabled flag indicating whether thedivision of the current block is allowed or not.
 25. The method of claim21, wherein the prediction sample is obtained by performing interprediction.
 26. A non-transitory computer-readable medium for storingdata associated with a video signal, comprising: a data stream stored inthe non-transitory computer-readable medium, the data stream beingencoded by an encoding method which comprising: obtaining a predictionsample of a current block; determining whether it is allowed to dividethe current block into two partitions or not; when it determined that adivision of the current block is allowed, determining whether to dividethe current block into two partitions or not; when it is determined todivide the current block, determining whether the current block ispartitioned in a symmetric form or in an asymmetric form, a firstindicator of 1-bit indicating whether the current block is partitionedin the symmetric form or in the asymmetric form being encoded in abitstream; dividing the current block in a vertical direction or in ahorizontal direction so as to generate two partitions; performing aninverse-transform for one of the two partitions; and obtaining areconstruction sample based on a residual sample obtained based on theinverse-transform and the prediction sample, wherein when it isdetermined to divide the current block in the asymmetric form, thecurrent block is partitioned into a first partition having a ¼ size ofthe current block and a second partition having ¾ size of the currentblock, and wherein a second indicator of 1-bit which is used todetermine locations of the first partition and the second partition isencoded in the bitstream.